<?php
require_once("../conf/db_connection.php");


$query_select = "SELECT * FROM truck";
$result_select = mysql_query($query_select) or die("SELECT TRUCCKS ".mysql_error());

$ctr = 00;
while($row_select = mysql_fetch_array($result_select))
{
if($ctr>59)
{
	$ctr = 0;
}
if($ctr<10)
{
	$sec = "0".$ctr;
}
else
{
	$sec = $ctr;
}
$query_up = "UPDATE truck SET available_date_time='".date("Y-m-d H:i:").$sec."' WHERE id='".$row_select['id']."'";
mysql_query($query_up) or die("UPDATE FAILED ".mysql_error());
echo date("Y-m-d H:i:").$sec."<br />";
$ctr++;
}

?>